Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 3fc321e80473f4e05d1156878b658a36e7eff01b


Parents : b312bd9
Author : JP Hastings-Spital <jphastings@gmail.com>
Signature : Signature validation error
Date : 2022-05-18T08:56:45+01:00
Committer : GitHub <noreply@github.com>
Date : 2022-05-18T08:56:45+01:00

Move --daemon to CMD from ENTRYPOINT

I've moved the `--daemon` command from `ENTRYPOINT` to `CMD` to allow users of the dockerfile some flexibility

The executable and/or arguments in `CMD` can be overridden easily by users of the container, but `ENTRYPOINT` is intended as a "this is always at the start of the command". ([reference](https://docs.docker.com/engine/reference/builder/#cmd))

For example, with the change in this commit:
- `docker run ghcr.io/markqvist/nomadnet:master --help` will output the same as `nomadnet --help`
- `docker run ghcr.io/markqvist/nomadnet:master` will run `nomadnet --daemon`
- `docker run ghcr.io/markqvist/nomadnet:master ""` will run `nomadnet` (if we wanted this to be a little more self-explaining, there could be a `--ui` flag which runs the UI and is default-on, so `docker run ghcr.io/markqvist/nomadnet:master --ui` would work)

Changes

1 files changed, 2 insertions(+), 1 deletions(-)

M Dockerfile +2 -1

Diff

diff --git a/Dockerfile b/Dockerfile
index d1c016d..ea3e1b3 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,4 +21,5 @@ COPY --from=build /opt/venv /opt/venv
VOLUME /root/.reticulum
VOLUME /root/.nomadnetwork
-ENTRYPOINT ["nomadnet", "--daemon"]
\ No newline at end of file
+ENTRYPOINT ["nomadnet"]
+CMD ["--daemon"]


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────